Correct math error in GPS_Math_Deg_To_DegMinSec.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Apr 2006 15:55:58 +0000 (15:55 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Apr 2006 15:55:58 +0000 (15:55 +0000)
gpsbabel/jeeps/gpsmath.c

index ac412f19697edf40a19896ff623f3a12f6a6d976..799147904e4978f1b595a59c3f7a59264108f901 100644 (file)
@@ -158,7 +158,8 @@ void GPS_Math_Deg_To_DegMinSec(double v, int32 *d, int32 *m, double *s)
     
     *d = (int32)v;
     t  = (v -(double)*d) * (double)60.0;
-    *s = (t-(double)*m) * (double)60.0;
+    *m = (v-(double)*d) * (double)60.0;
+    *s = (t - (int32)t) * (double)60.0;
 
     if(*s>(double)59.999)
     {